Repository navigation
fix(compiler-vapor): propagate component root through KeepAlive - #15583
edison1105 merged 4 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
|
This aligns the normal KeepAlive-root case with VDOM, but I reproduced two regressions on this head that pass on the base:
|
|
Both reproduce here, thanks. Numbers from my side. 1. Slot boundary. Confirmed: One thing worth knowing: the same leak is already on 2. Listener. Confirmed, and it depends on the child's shape. Vapor wrapper,
The last row is the one I would flag: on the base the listener never fires for a compiled child. The interop path drops it in one shape and, with this change, installs it twice in another. So three lines are not enough. From what I can see the fix is a guard at the slot boundary — which also closes the pre-existing outlet case — plus not installing the fallthrough listener on the DOM when it already went through the vdom child's props. I am happy to take it that far, with tests for all three shapes. I am equally happy to close this and leave it to you if you would rather do it in one pass with the rest of the interop work. Just say which. |
|
@ValentinYoushkevich |
dd0a97d to
5bea80e
Compare
|
Both fixed, rebased onto current Slot boundary. One line in It updates 7 lines of The 2 remaining are Listener. Two notes on the numbers: on the base no interop child shape gets the listener without a reactivation, so the 0-vs-1 split was a single-toggle artifact; and Still divergent, and not this PR: a vdom child re-applying 8 regression tests, each with the vdom equivalent as the oracle and negative controls run against the unpatched head. |
A component whose template root is a KeepAlive never received its fallthrough attributes: the single root lookup treats template and Transition as transparent, but not KeepAlive, so the cached child was not compiled as the component root and class, style and other attrs were dropped.
ecfde02 to
c1a5d93
Compare
A component whose template root is a
<KeepAlive>never receives its fallthrough attributes.class,styleand any other non-prop attribute are dropped, and the same binding works if the root is a<Transition>instead.https://play.vuejs.org/#eNq1kkFv1DAQhf/Kw5cFaZNUICHIeiP1iLhwQFwwQt542rWa2NbYDVut9r+jJEuSLaL00pvHmnkz35s5iusQ8u6eRClkrNmGhEjpPqDTwXOlnG2D54RvVn8mCteN7Qg37Fus8mL52YuslulfWbtok/VumT//ngtkMbatlFNOJmpDoxNVygHyVZYh6pagU+K4RvrlUe9tY5hcCe8I7H2CjZDTHNUaaU/waU8MOberkGWj6gVK3egYt0rs/IGMEkg2NbRVYu87YrSkBIqpbIH0zDpZLIiUkzE9NP0zH+pwhLExNPqhxK7x9d0GO8+GuMTbcED0jTVgMhsEbYx1tyU+hMMGreZb64YAVxucBhfPymItHq/lf7v95BzxtKQhesZyZsf7EJCjTKJD2irxZzFTVgnnz3Tr/jkYNrtbLOUuXBuBLu/mZYgWx/IU0pxWnoGgnRmBoJltt+S6EH0MNk32TyBDN9bRF/Yhvv6+6idZ/XjzNIaxXXU8DlPjdJJFH//d+mdHHK13ohTv8vf5VcZ1/lGcfgMedWuD
The single root lookup in
transform.tstreats<template>and<Transition>as transparent, but not<KeepAlive>, so the child inside is not compiled as the component root and the runtime has no root element to apply the attrs to. #15275 made<Transition>transparent for the same reason and did not carry it over.Same shape as that fix: one more tag in the same condition. The tests cover a static child,
v-ifbranches restored from the cache, and class merging with the child's own class.